package com.dduggs.note.adapter;

/**
 * Created by ChenJiasheng on 2017/10/27.
 */
public class NoteBook {

    private ThreePlugIf plug;

    public NoteBook(ThreePlugIf plug) {
        this.plug = plug;
    }

    //    使用插座充电
    public void charge() {
        plug.powerWithThree();
    }

    public static void main(String[] args) {

        GBTwoPlug twoPlug=new GBTwoPlug();
        ThreePlugIf plug=new TwoPlugAdapter(twoPlug);
        NoteBook nb = new NoteBook(plug);
        nb.charge();
    }
}
